package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.goods.GoodsCartBO;
import com.ymk.service.IGoodsCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品购物车 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-13
 */
@Service
public class GoodsCartService implements IGoodsCartService {

    @Override
    public GoodsCartBO get(Map param) {
    return this.daoRouter.queryForObject("GoodsCart.loadGoodsCart",param);
    }

    @Override
    public List<GoodsCartBO> list(Map param) {
        return this.daoRouter.query("GoodsCart.loadGoodsCart",param);
    }

    @Override
    public List<GoodsCartBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("GoodsCart.loadGoodsCartForPage",pagination);
    }

    @Override
    public void post(GoodsCartBO param) {
        this.daoRouter.insert("AGoodsCart.insertGoodsCart",param);
    }

    @Override
    public void update(GoodsCartBO param) {
        this.daoRouter.update("AGoodsCart.updateGoodsCart",param);
    }

    @Override
    public void del(Map param) {
        this.daoRouter.update("GoodsCart.delGoodsCart",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
